<template>
	<view class="li-item">
		<view class="li-item-img"><image :src="item.listPicture.length!=0 ? https+item.listPicture[0].picturePath : '../../static/no_carpicture.jpg' " mode="scaleToFill"></image></view>
		<view class="li-item-cont">
			<view class="li-item-cont-title">{{ item.modelName }}</view>
			<!-- <view class="li-item-cont-bq">{{ item.carRegistrationTime  }}上牌/{{ item.mileage }}万公里/{{ item.cityName }}</view> -->
			<view class="li-item-cont-bq">{{item.carAge}}年/{{ item.mileage }}万公里/{{ item.cityName }}</view>
			<view class="li-item-cont-text">
				<!-- <text class="li-item-cont-text-time">{{ item.platformName }} {{ item.releaseTime | changeDates(5,10) }}</text> -->
				<text class="li-item-cont-text-w">{{ item.sellingPrice }}万</text>
				
				<view class="li-item-cont-money"> <image src="../../static/gu.png" mode=""></image> {{ item.platformEstimatedPrice }}万
				<!-- <text>性价比</text>{{ item.costPerformance }}% -->
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import API from "@/api/index.js"
	export default {
		name:"tab-sjztitem",
		props:{
			item:{
				type: Object,
				default(){
					return {}
				}
			}
		},
		data() {
			return {
				https: getApp().globalData.picturePath,
			};
		},
		methods:{
			goReport(item){
				console.log(item)
				let data = {
						cityId: item.cityId,
						brandId: item.brandId,
						seriesId: item.seriesId,
						modelId: item.modelId,
						regDate: item.carRegistrationTime.substring(0,10),
						mile: item.mileage,
						fullyChargedEndurance: item.rechargeMileage
					}
					API.getFastValuation(data).then(res=>{
						if(res.code==200){
							uni.navigateTo({
								url:`/pagesA/assessment/mianfeiReportDetail?data=${encodeURIComponent(JSON.stringify(res.data))}`
							})
						}else{
							if(res.message == 'token验证失效'){
								res.message ="未登录"
							}
							this.$u.toast(res.message || '请求失败');
						}
					})
			}
		}
	}
</script>

<style scoped lang="scss">
	.li-item{
		width: 335rpx;
		// display:-webkit-box;;
	
		.li-item-img{
			width: 335rpx;
			height: 257rpx;
			margin-right: 20rpx;
			// margin-top:10rpx;
			image{
				width: 100%;
				height: 100%;
				border-radius: 3px;
			}
		}
		.li-item-cont{
			// flex: 1;
			// width: 100%;
			// width: 335rpx;
			margin-top: 19rpx;
			padding: 0 10rpx;
			.li-item-cont-title{
				font-family: PingFangSC-Regular;
				font-size: 30rpx;
				max-height: 85rpx;
				color: #323232;
				line-height: 40rpx;
				font-weight: 550;
				overflow: hidden;
				text-overflow: ellipsis;
				display: -webkit-box;
				-webkit-line-clamp: 2;
				-webkit-box-orient: vertical;
			}
			.li-item-cont-bq{
				margin-top: 10rpx;
				font-family: PingFangSC-Regular;
				font-size: 24rpx;
				color: #999999;
				overflow: hidden;
				    text-overflow: ellipsis;
				    white-space: nowrap;
			}
			// .li-item-cont-money{
			// 	margin-top: 12rpx;
			// 	font-family: PingFangSC-Regular;
			// 	font-size: 24rpx;
			// 	color: #42C7E6;
			// 	text{
			// 		color: #fff;
			// 		background: #42C7E6;
			// 		border-radius: 6rpx;
			// 		padding: 4rpx 12rpx;
			// 		box-sizing: border-box;
			// 		font-family: PingFangSC-Regular;
			// 		font-size: 24rpx;
			// 		margin: 0rpx 12rpx;
			// 		&:first-of-type{
			// 			margin-left: 0rpx;
			// 		}
			// 	}
			// }
			.li-item-cont-text{
				display: flex;
				// justify-content: space-between;
				align-items: center;
				font-size: 20rpx;
				
				margin-top: 7rpx;
				.li-item-cont-text-time{
					font-size: 18rpx;
					color: #666;
				}
				.li-item-cont-text-w{
					font-size: 34rpx;
					color: #FF552E;
					margin-top: 10rpx;
					font-weight: 550;
					width: 140rpx;
				}
				
				// .li-item-cont-text-r{
				// 	// width: 180rpx;
				// 	height: 39rpx;
				// 	// background: #FFF2F1;
				// 	border-radius: 4rpx;
				// 	display: flex;
				// 	    line-height: 39rpx;
				// 	// color: #FD7E6E;
				// 	font-size: 24rpx;
				// 	color: #C2C2C2;
				// }
				.cjbg{
					width: 23rpx;
					height: 23rpx;
					padding: 9rpx 10rpx 5rpx 25rpx;
				}
				.cjbg1{
					width: 8rpx;
					height: 12rpx;
					padding: 15rpx 10rpx 0;
				}
			}
		}
	}
	.li-item-cont-text-r{
		width: 349.9rpx;
		height: 43rpx;
		line-height: 43rpx;
		font-size: 24rpx;
		color: #fff;
		background: #e0efff;
		margin-top: 15rpx;
		text{
			padding-left: 10rpx;
		}
	}
	.li-item-cont-money{
		display: flex;
		margin-top: 20rpx;
		font-size: 24rpx;
		color: #FF552E;
		height: 43rpx;
		line-height: 43rpx;
		image{
			width: 22.5rpx;
			height: 22.5rpx;
			margin-top: 8rpx;
			margin-right: 8rpx;
		}
		}
	
</style>
